<?php
/**
 *@file feedback.php
 *@author Zhe.Zhou(zhouzhe@haibao.com)
 *@date 2015-7-29 下午4:19:39
 *@brief  
 */
namespace haibao\app\business;

use \haibao\app\data\Feedback as FeedbackData;
class Feedback extends Base{
	public static function getFeedbackList($feedbackFilter){
		$feedbackData = new FeedbackData();
		return $feedbackData->getAll($feedbackFilter);
	}
	
	public static function deleteFeedback($id){
		$feedbackData = new FeedbackData();
		return $feedbackData->removeById($id);
	}
	
	/**
	 * @param \haibao\app\model\data\Feedback $model
	 */
	public static function saveFeedback($model){
	    if(!$model->Content || !$model->Question1 || !$model->Question2 || !$model->Model){
	        throw new BusinessException('请求参数不完整', self::DATA_ERROR_CODE_EMPTY);
	    }
	    $model->CreateTime = new \DateTime();
	    $data = new FeedbackData();
	    $data->saveFeedback($model);
	}
}